<!--
 * @Author: your name
 * @Date: 2021-08-16 20:02:57
 * @LastEditTime: 2021-08-24 18:10:06
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \orderSystems\src\views\menuMag\DishTable.vue
-->
<template>
  <!-- 规格管理，菜品类别，菜品口味复用组件 -->
  <div id="dish-table">
    <!-- 表格title -->
    <el-container>
      <el-header class="table-header">
        <div class="table-title">
          <el-row class="title-row">
            <el-col :span="18">{{ moudleName }}</el-col>
            <el-col :span="6">
              <el-button
                class="btn-size"
                type="primary"
                icon="el-icon-circle-plus-outline"
                @click="dialogFormVisible = true"
                >新增</el-button
              >
              <el-button
                class="btn-size"
                type="danger"
                icon="el-icon-delete"
                @click="batchDelete"
                >批量删除</el-button
              >
              <el-dialog
                title="新增"
                :visible.sync="dialogFormVisible"
                center
                width="30%"
                top="30vh"
              >
                <el-form :model="form">
                  <el-form-item label="类别名称:" :label-width="formLabelWidth">
                    <el-input v-model="form.name" clearable autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="备注:" :label-width="formLabelWidth">
                    <el-input
                      clearable
                      v-model="form.remarks"
                      type="textarea"
                      :rows="4"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="状态" :label-width="formLabelWidth">
                    <el-switch
                      v-model="form.status"
                      active-color="#13ce66"
                      inactive-color="#9E99B9"
                    >
                    </el-switch>
                  </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
                  <el-button @click="cancelAdd">取 消</el-button>
                  <el-button type="primary" @click="defineAdd">确 定</el-button>
                </div>
              </el-dialog>
            </el-col>
          </el-row>
        </div>
      </el-header>
    </el-container>
    <!-- 表格数据 -->
    <el-container>
      <el-main class="table-content">
        <div class="table-bgc">
          <div class="table-padding">
            <el-table
              ref="multipleTable"
              :data="tableDatas"
              tooltip-effect="dark"
              border
              @selection-change="handleSelectionChange"
              class="table-box"
            >
              <el-table-column type="selection" width="55" align="center">
              </el-table-column>
              <el-table-column label="序号" width="120" align="center">
                <template slot-scope="scope">{{ scope.$index + 1 }}</template>
              </el-table-column>
              <el-table-column :label="tableType" width="150" align="center">
                <template slot-scope="scope">{{ scope.row.category }}</template>
              </el-table-column>
              <el-table-column
                label="备注"
                align="center"
                show-overflow-tooltip
              >
                <template slot-scope="scope">{{ scope.row.notes }}</template>
              </el-table-column>
              <el-table-column label="状态" width="240" align="center">
                <template slot-scope="scope">{{
                  scope.row.status == 0 ? "正常" : "待开发"
                }}</template>
              </el-table-column>
              <el-table-column label="操作" width="240" align="center">
                <template slot-scope="scope">
                  <el-button
                    type="danger"
                    size="mini"
                    plain
                    @click="handleEdit(scope.row.id)"
                    icon="el-icon-edit"
                    >编辑</el-button
                  >
                  <el-button
                    size="mini"
                    type="warning"
                    plain
                    @click="handleDelete(scope.row.id)"
                    icon="el-icon-delete"
                    >删除</el-button
                  >
                  <el-dialog
                    title="编辑"
                    :visible.sync="dialogFormVisible1"
                    center
                    width="30%"
                    top="30vh"
                  >
                    <el-form :model="editForm">
                      <el-form-item
                        label="类别名称:"
                        :label-width="formLabelWidth"
                      >
                        <el-input
                          v-model="editForm.name"
                          autocomplete="off"
                        ></el-input>
                      </el-form-item>
                      <el-form-item label="备注:" :label-width="formLabelWidth">
                        <el-input
                          v-model="editForm.remarks"
                          type="textarea"
                          :rows="4"
                          autocomplete="off"
                        ></el-input>
                      </el-form-item>
                      <el-form-item label="状态" :label-width="formLabelWidth">
                        <el-switch
                          v-model="editForm.status"
                          active-color="#13ce66"
                          inactive-color="#9E99B9"
                        >
                        </el-switch>
                      </el-form-item>
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                      <el-button @click="cancelEdit">取 消</el-button>
                      <el-button type="primary" @click="defineEdit"
                        >确 定</el-button
                      >
                    </div>
                  </el-dialog>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import bus from "../../EventBus";
export default {
  data() {
    return {
      multipleSelection: [], //用于存放选中的数据的数组
      dialogFormVisible: false, //点击添加弹出框的默认值，默认不弹框，这false
      dialogFormVisible1: false,
      nowPageDataAll: 0, //当前点击页的数据条数
      nowPage: 0, //当前点击页
      categoryId: 0, //点击编辑行数据的id
      form: {
        //对话框弹窗相应的数据对象
        name: "", //类别名称
        remarks: "", //备注
        status: "false", //状态
      },
      editForm: {
        //对话框弹窗相应的数据对象
        name: "", //类别名称
        remarks: "", //备注
        status: "false", //状态
      },
      formLabelWidth: "80px", //对话框内容的宽度
    };
  },
  //自定义属性，接收父级数据
  props: {
    moudleName: {
      //模块名字
      type: String,
      default: "",
    },
    tableType: {
      //表格数据表头的菜的类型名称
      type: String,
      default: "",
    },
    tableDatas: {
      //从父组件接收表格数据
      type: Array,
      /*  default: [
        {
          id: 0, //序号
          category: "", //类别名称
          status: 0, //状态
          notes: "", //备注
        },
      ], */
    },
    clickNowPage: {
      //当前页，从父级接收
      default: 1,
      type: Number,
    },
    pageCount: {
      //每页显示数据条数，从父级接收
      default: 5,
      type: Number,
    },
    nowPageSize: {
      //当前点击页的数据条数
      default: 0,
      type: Number,
    },
  },
  created() {
    /*  bus.$on('shareTableData',(val)=>{
      // this.tableData=val.tableData;//查询得到的数据
      this.flag=val.searchstatus;//查询时，标志变量变为true
    }) */
  },
  methods: {
    /**
     * @description: 添加菜品类别函数
     * @param {*}
     * @return {*}
     */
    async defineAdd() {
      this.dialogFormVisible = false; //点击确定，关闭对话框
      switch (this.moudleName) {
        case "菜品类别":
          const { data: res } = await this.axios.post("/dishesCategory/add", {
            category: this.form.name, //菜品类别变量
            notes: this.form.remarks, //备注
            status: this.form.status ? 0 : 1, //0 表示正常 1表示待开发
          });
          if (res.code == 200) {
            // console.log(res);
            this.$message({
              message: "添加成功！",
              type: "success",
              duration: "500",
            });
            this.$emit("shareData", {
              nowPage: this.clickNowPage,
              pageCount: this.pageCount,
            });
          } else {
            throw new console.error("服务器错误");
          }
          break;
        case "菜品口味":
          const { data: res1 } = await this.axios.post("/dishTaste/add", {
            taste: this.form.name, //菜品类别变量
            notes: this.form.remarks, //备注
            status: this.form.status ? 0 : 1, //0 表示正常 1表示待开发
          });
          if (res1.code == 200) {
            console.log(res1);
            this.$message({
              message: "添加成功！",
              type: "success",
              duration: "500",
            });
            this.$emit("shareData", {
              nowPage: this.clickNowPage,
              pageCount: this.pageCount,
            });
          } else {
            throw new console.error("服务器错误");
          }
          break;
        case "规格":
          const { data: res2 } = await this.axios.post(
            "/dishSpecification/add",
            {
              specification: this.form.name, //菜品类别变量
              notes: this.form.remarks, //备注
              status: this.form.status ? 0 : 1, //0 表示正常 1表示待开发
            }
          );
          if (res2.code == 200) {
            // console.log(res2);
            this.$message({
              message: "添加成功！",
              type: "success",
              duration: "500",
            });
            this.$emit("shareData", {
              nowPage: this.clickNowPage,
              pageCount: this.pageCount,
            });
          } else {
            throw new console.error("服务器错误");
          }
          break;
      }
    },
    /**
     * @description:添加对话框弹窗点击取消时隐藏对话框
     * @param {*}
     * @return {*}
     */
    cancelAdd() {
      this.dialogFormVisible = false;
      this.$message({
        message: "取消添加！",
        type: "info",
        duration: "500",
      });
    },
    toggleSelection(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    /**
     * @description: 获取选中行的表格数据的数组，用于批量删除
     * @param {*} val //选中的数据数组
     * @return {*}
     */
    handleSelectionChange(val) {
      //val获取选中的数据数组
      let idArr = []; //用于存储表格每行数据的id的数据
      val.forEach((item) => {
        //遍历数组，获取每条数据的id,
        idArr.push(item.id); //将id存储到新数组中
      });
      this.multipleSelection = idArr; //将新数组的值赋值给data中定义的数组
    },
    /**
     * @description: 实现批量删除的函数
     * @param {*}
     * @return {*}
     */
    async batchDelete() {
      switch (this.moudleName) {
        case "菜品类别":
          const confirm = await this.$confirm(
            //this.$fonfirm是一个promise对象，因此用async await
            "此操作将永久删除数据, 是否继续?",
            "提示",
            {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            }
          ).catch((err) => err); //点击确认，返回confirm 点击取消，返回 cancel
          if (confirm != "confirm") {
            //如果不是点击确认，表示不删除
            this.$message({
              type: "info",
              message: "已取消删除",
              duration: "500",
            });
          } else {
            const { data: res } = await this.axios.post(
              "/dishesCategory/deleteIds",
              {
                ids: this.multipleSelection, //删除数据的id数组
              }
            );
            if (res.code == 200) {
              // console.log(res);
              this.$message({
                type: "success",
                message: "删除成功!",
                duration: "500",
              });
              this.nowPageDataAll = this.nowPageSize - 1; //data里面定义的当前页数据-1后的值
              if (this.nowPageDataAll == 0) {
                //当前页数据删完时
                this.nowPage = this.clickNowPage; //首先讲props中的当前页页面赋值给data中的当前页页面
                this.nowPage = this.nowPage - 1; //页码-1,回到上一页
                if (this.nowPage <= 0) {
                  this.nowPage = 1; //只有一页时就在第一页
                }
              } else {
                this.nowPage = this.clickNowPage; //当前页没删完时，就在当前页
              }
              this.$emit("shareData", {
                //子传父自定义事件
                nowPage: this.nowPage,
                pageCount: this.pageCount,
              });
            } else {
              throw new console.error("删除失败");
            }
          }
          break;
        case "菜品口味":
          const confirmTaste = await this.$confirm(
            //this.$fonfirm是一个promise对象，因此用async await
            "此操作将永久删除数据, 是否继续?",
            "提示",
            {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            }
          ).catch((err) => err); //点击确认，返回confirm 点击取消，返回 cancel
          if (confirmTaste != "confirm") {
            //如果不是点击确认，表示不删除
            //取消选中
            this.$message({
              type: "info",
              message: "已取消删除",
              duration: "500",
            });
          } else {
            const { data: res } = await this.axios.post(
              "/dishTaste/deleteIds",
              {
                ids: this.multipleSelection, //删除数据的id数组
              }
            );
            if (res.code == 200) {
              // console.log(res);
              this.$message({
                type: "success",
                message: "删除成功!",
                duration: "500",
              });
              this.nowPageDataAll = this.nowPageSize - 1; //data里面定义的当前页数据-1后的值
              if (this.nowPageDataAll == 0) {
                //当前页数据删完时
                this.nowPage = this.clickNowPage; //首先讲props中的当前页页面赋值给data中的当前页页面
                this.nowPage = this.nowPage - 1; //页码-1,回到上一页
                if (this.nowPage <= 0) {
                  this.nowPage = 1; //只有一页时就在第一页
                }
              } else {
                this.nowPage = this.clickNowPage; //当前页没删完时，就在当前页
              }
              this.$emit("shareData", {
                //子传父自定义事件
                nowPage: this.nowPage,
                pageCount: this.pageCount,
              });
            } else {
              throw new console.error("删除失败");
            }
          }
          break;
        case "规格":
          const confirmSpe = await this.$confirm(
            //this.$fonfirm是一个promise对象，因此用async await
            "此操作将永久删除数据, 是否继续?",
            "提示",
            {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            }
          ).catch((err) => err); //点击确认，返回confirm 点击取消，返回 cancel
          if (confirmSpe != "confirm") {
            //如果不是点击确认，表示不删除
            //取消选中
            this.$message({
              type: "info",
              message: "已取消删除",
              duration: "500",
            });
          } else {
            const { data: res } = await this.axios.post(
              "/dishSpecification/deleteIds",
              {
                ids: this.multipleSelection, //删除数据的id数组
              }
            );
            if (res.code == 200) {
              // console.log(res);
              this.$message({
                type: "success",
                message: "删除成功!",
                duration: "500",
              });
              this.nowPageDataAll = this.nowPageSize - 1; //data里面定义的当前页数据-1后的值
              if (this.nowPageDataAll == 0) {
                //当前页数据删完时
                this.nowPage = this.clickNowPage; //首先讲props中的当前页页面赋值给data中的当前页页面
                this.nowPage = this.nowPage - 1; //页码-1,回到上一页
                if (this.nowPage <= 0) {
                  this.nowPage = 1; //只有一页时就在第一页
                }
              } else {
                this.nowPage = this.clickNowPage; //当前页没删完时，就在当前页
              }
              this.$emit("shareData", {
                //子传父自定义事件
                nowPage: this.nowPage,
                pageCount: this.pageCount,
              });
            } else {
              throw new console.error("删除失败");
            }
          }
          break;
      }
    },
    /* *
     * @description: 获取表格某一行数据的id和数据
     * @param {*} id  编辑行数据的id
     * @return {*}
     */
    async handleEdit(id) {
      this.dialogFormVisible1 = true; //修改变量值，弹出弹框
      this.categoryId = id;
      switch (this.moudleName) {
        case "菜品类别":
          const { data: res } = await this.axios.get(
            "/dishesCategory/findById/" + id
          );
          if (res.code == 200) {
            let categoryData = res.data; //获取id对应的数据，并将数据赋值给editForm
            console.log(categoryData);
            /* for(var i in categoryData){
        this.editForm[i]=categoryData[i];
      }
      console.log(this.editForm); */
            this.editForm.name = categoryData.category;
            this.editForm.remarks = categoryData.notes;
            this.editForm.status = categoryData.status == 0 ? true : false;
          }
          break;
        case "菜品口味":
          const { data: res1 } = await this.axios.get("/dishTaste/findById/" + id);
          if (res1.code == 200) {
            let categoryData = res1.data; //获取id对应的数据，并将数据赋值给editForm
            console.log(categoryData);
            /* for(var i in categoryData){
        this.editForm[i]=categoryData[i];
      }
      console.log(this.editForm); */
            this.editForm.name = categoryData.taste;
            this.editForm.remarks = categoryData.notes;
            this.editForm.status = categoryData.status == 0 ? true : false;
          }
          break;
        case "规格":
          const { data: res2 } = await this.axios.get(
            "/dishSpecification/findById/" + id
          );
          if (res2.code == 200) {
            let categoryData = res2.data; //获取id对应的数据，并将数据赋值给editForm
            // console.log(categoryData);
            /* for(var i in categoryData){
        this.editForm[i]=categoryData[i];
      }
      console.log(this.editForm); */
            this.editForm.name = categoryData.specification;
            this.editForm.remarks = categoryData.notes;
            this.editForm.status = categoryData.status == 0 ? true : false;
          }
          break;
      }
    },
    /**
     * @description: 编辑对话框弹窗点击取消时隐藏对话框
     * @param {*}
     * @return {*}
     */
    cancelEdit() {
      this.dialogFormVisible1 = false;
      this.$message({
        message: "取消编辑！",
        type: "info",
        duration: "500",
      });
    },
    /**
     * @description: 点击编辑弹框的确认按钮，修改菜品分类
     * @param {*}
     * @return {*}
     */
    async defineEdit() {
      switch (this.moudleName) {
        case "菜品类别":
          const { data: res } = await this.axios.post(
            "/dishesCategory/update",
            {
              category: this.editForm.name,
              id: this.categoryId,
              notes: this.editForm.remarks,
              status: this.editForm.status ? 0 : 1, //0 表示正常 1表示待开发
            }
          );
          if (res.code == 200) {
            this.$message({
              message: "编辑成功！",
              type: "success",
              duration: "500",
            });
            this.dialogFormVisible1 = false; //点击确定，关闭对话框
            this.$emit("shareData", {
              nowPage: this.clickNowPage,
              pageCount: this.pageCount,
            });
          } else {
            throw new console.error("服务器错误");
          }
          break;
        case "菜品口味":
          const { data: res1 } = await this.axios.post("/dishTaste/update", {
            taste: this.editForm.name,
            id: this.categoryId,
            notes: this.editForm.remarks,
            status: this.editForm.status ? 0 : 1, //0 表示正常 1表示待开发
          });
          if (res1.code == 200) {
            this.$message({
              message: "编辑成功！",
              type: "success",
              duration: "500",
            });
            this.dialogFormVisible1 = false; //点击确定，关闭对话框
            this.$emit("shareData", {
              nowPage: this.clickNowPage,
              pageCount: this.pageCount,
            });
          } else {
            throw new console.error("服务器错误");
          }
          break;
        case "规格":
          const { data: res2 } = await this.axios.post(
            "/dishSpecification/update",
            {
              specification: this.editForm.name,
              id: this.categoryId,
              notes: this.editForm.remarks,
              status: this.editForm.status ? 0 : 1, //0 表示正常 1表示待开发
            }
          );
          if (res2.code == 200) {
            this.$message({
              message: "编辑成功！",
              type: "success",
              duration: "500",
            });
            this.dialogFormVisible1 = false; //点击确定，关闭对话框
            this.$emit("shareData", {
              nowPage: this.clickNowPage,
              pageCount: this.pageCount,
            });
          } else {
            throw new console.error("服务器错误");
          }
          break;
      }
    },

    /**
     * @description: 根据id删除表格一行数据的函数
     * @param {*} id  当前删除行数据的id
     * @return {*}
     */
    async handleDelete(id) {
      switch (this.moudleName) {
        case "菜品类别":
          const confirm = await this.$confirm(
            //this.$fonfirm是一个promise对象，因此用async await
            "此操作将永久删除该文件, 是否继续?",
            "提示",
            {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            }
          ).catch((err) => err); //点击确认，返回confirm 点击取消，返回 cancel
          if (confirm != "confirm") {
            //如果不是点击确认，表示不删除
            this.$message({
              type: "info",
              message: "已取消删除",
              duration: "500",
            });
          } else {
            //确认删除时发起ajax请求，删除数据
            this.axios
              .get("/dishesCategory/delete/" + id)
              .then((res) => {
                //  console.log(res);
                if (res.data.code == 200) {
                  this.$message({
                    type: "success",
                    message: "删除成功!",
                    duration: "500",
                  }); //后面将props值赋值给data中的相应值再修改，主要是因为pros中的值不能修改
                  this.nowPageDataAll = this.nowPageSize - 1; //data里面定义的当前页数据-1后的值
                  if (this.nowPageDataAll == 0) {
                    //当前页数据删完时
                    this.nowPage = this.clickNowPage; //首先讲props中的当前页页面赋值给data中的当前页页面
                    this.nowPage = this.nowPage - 1; //页码-1,回到上一页
                    if (this.nowPage <= 0) {
                      this.nowPage = 1; //只有一页时就在第一页
                    }
                  } else {
                    this.nowPage = this.clickNowPage; //当前页没删完时，就在当前页
                  }
                  this.$emit("shareData", {
                    //子传父自定义事件
                    nowPage: this.nowPage,
                    pageCount: this.pageCount,
                  });
                }
              })
              .catch((err) => err);
          }
          break;
        case "菜品口味":
          const confirmTaste = await this.$confirm(
            //this.$fonfirm是一个promise对象，因此用async await
            "此操作将永久删除该数据, 是否继续?",
            "提示",
            {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            }
          ).catch((err) => err); //点击确认，返回confirm 点击取消，返回 cancel
          if (confirmTaste != "confirm") {
            //如果不是点击确认，表示不删除
            this.$message({
              type: "info",
              message: "已取消删除",
              duration: "500",
            });
          } else {
            //确认删除时发起ajax请求，删除数据
            this.axios
              .get("/dishTaste/delete/" + id)
              .then((res) => {
                //  console.log(res);
                if (res.data.code == 200) {
                  this.$message({
                    type: "success",
                    message: "删除成功!",
                    duration: "500",
                  }); //后面将props值赋值给data中的相应值再修改，主要是因为pros中的值不能修改
                  this.nowPageDataAll = this.nowPageSize - 1; //data里面定义的当前页数据-1后的值
                  if (this.nowPageDataAll == 0) {
                    //当前页数据删完时
                    this.nowPage = this.clickNowPage; //首先讲props中的当前页页面赋值给data中的当前页页面
                    this.nowPage = this.nowPage - 1; //页码-1,回到上一页
                    if (this.nowPage <= 0) {
                      this.nowPage = 1; //只有一页时就在第一页
                    }
                  } else {
                    this.nowPage = this.clickNowPage; //当前页没删完时，就在当前页
                  }
                  this.$emit("shareData", {
                    //子传父自定义事件
                    nowPage: this.nowPage,
                    pageCount: this.pageCount,
                  });
                }
              })
              .catch((err) => err);
          }
          break;
        case "规格":
          const confirmSpe = await this.$confirm(
            //this.$fonfirm是一个promise对象，因此用async await
            "此操作将永久删除该数据, 是否继续?",
            "提示",
            {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            }
          ).catch((err) => err); //点击确认，返回confirm 点击取消，返回 cancel
          if (confirmSpe != "confirm") {
            //如果不是点击确认，表示不删除
            this.$message({
              type: "info",
              message: "已取消删除",
              duration: "500",
            });
          } else {
            //确认删除时发起ajax请求，删除数据
            this.axios
              .get("/dishSpecification/delete/" + id)
              .then((res) => {
                //  console.log(res);
                if (res.data.code == 200) {
                  this.$message({
                    type: "success",
                    message: "删除成功!",
                    duration: "500",
                  }); //后面将props值赋值给data中的相应值再修改，主要是因为pros中的值不能修改
                  this.nowPageDataAll = this.nowPageSize - 1; //data里面定义的当前页数据-1后的值
                  if (this.nowPageDataAll == 0) {
                    //当前页数据删完时
                    this.nowPage = this.clickNowPage; //首先讲props中的当前页页面赋值给data中的当前页页面
                    this.nowPage = this.nowPage - 1; //页码-1,回到上一页
                    if (this.nowPage <= 0) {
                      this.nowPage = 1; //只有一页时就在第一页
                    }
                  } else {
                    this.nowPage = this.clickNowPage; //当前页没删完时，就在当前页
                  }
                  this.$emit("shareData", {
                    //子传父自定义事件
                    nowPage: this.nowPage,
                    pageCount: this.pageCount,
                  });
                }
              })
              .catch((err) => err);
          }
          break;
      }
    },
  },
};
</script>

<style lang='less' scoped>
.table-header {
  padding: 0;
  & > .table-title {
    margin: 1rem;
    background-color: #f5f9fc;
    box-sizing: border-box;
    height: 4rem;
    & > .title-row {
      line-height: 4rem;
      padding-left: 1rem;
      color: #666;
      font-weight: 500;
    }
  }
}
.btn-size {
  height: 3rem;
  padding: 0.6rem 2rem;
}

.table-content {
  padding: 0;
  & > .table-bgc {
    margin: 0 1rem 1rem;
    background-color: #f5f9fc;
    // height: 50rem;
    overflow: hidden;
    box-sizing: border-box;
    & > .table-padding {
      margin: 1rem;
    }
  }
}
</style>
